class Totalname{
    var namess:MutableList<MutableList<People>> = mutableListOf()
    fun paixu(){
        val x=namess
        for(names1 in x){
            for(names2 in x){
                if(names1[0].pinyin[0].compareTo(names2[0].pinyin[0])<0){
                    val names3=names1
                    namess[namess.indexOf(names1)]=names2
                    namess[namess.indexOf(names2)]=names3
                }
            }
        }
        for(names in x){
            val i=names
            for(people1 in names){
                for(people2 in names){
                    if(people1.pinyin0.compareTo(people2.pinyin0)<0){
                        val people3=people1
                        i[i.indexOf(people1)]=people2
                        i[i.indexOf(people2)]=people3
                    }
                }
            }
            namess[namess.indexOf(names)]=i
        }
    }
    fun printall(){
        for(names in namess){
            println("${names[0].pinyin[0].uppercaseChar()}")
            for(people in names){
                println("${people.name}  ${people.pinyin}")
            }
        }
    }
    fun screen(people: People):Boolean{
        for(names in namess){
            if(names[0].pinyin[0]==people.pinyin[0]){
                return false
            }
        }
        return true
    }
}